﻿<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AdRotatorExampleWin8"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:AdRotatorWin8="using:AdRotatorWin8"
    x:Class="AdRotatorExampleWin8.MainPage"
    mc:Ignorable="d">
	<Page.Resources>
		<Style x:Key="AdRotatorButton" TargetType="Button">
			<Setter Property="Background" Value="{StaticResource ButtonBackgroundThemeBrush}"/>
			<Setter Property="Foreground" Value="{StaticResource ButtonForegroundThemeBrush}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonBorderThemeBrush}"/>
			<Setter Property="BorderThickness" Value="{StaticResource ButtonBorderThemeThickness}"/>
			<Setter Property="Padding" Value="12,4,12,4"/>
			<Setter Property="HorizontalAlignment" Value="Left"/>
			<Setter Property="VerticalAlignment" Value="Center"/>
			<Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
			<Setter Property="FontWeight" Value="SemiBold"/>
			<Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="PointerOver">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonPointerOverForegroundThemeBrush}"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonPressedForegroundThemeBrush}"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonDisabledForegroundThemeBrush}"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualWhite"/>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBlack"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unfocused"/>
									<VisualState x:Name="PointerFocused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" Margin="3" Background="#FF005DFF">
								<ContentPresenter x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
							</Border>
							<Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1"/>
							<Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Page.Resources>

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    	<Grid.ColumnDefinitions>
    		<ColumnDefinition Width="0.5*"/>
    		<ColumnDefinition Width="0.5*"/>
    	</Grid.ColumnDefinitions>
    	<Button x:Name="LaunchBlankPage" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource AdRotatorButton}" Width="350" Height="350" Click="LaunchBlankPage_Click">
    		<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Launch Blank Template" VerticalAlignment="Top" FontSize="48" TextAlignment="Center"/>
    	</Button>
    	<Button x:Name="LaunchLayoutAwarePage" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource AdRotatorButton}" Width="350" Height="350" Grid.Column="1" Click="LaunchLayoutAwarePage_Click">
    		<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="Launch LayourAware Template" VerticalAlignment="Top" FontSize="48" TextAlignment="Center"/>
    	</Button>
    	<TextBlock TextWrapping="Wrap" Text="AdRotator Samples" VerticalAlignment="Top" FontFamily="Segoe WP Black" FontSize="64" Grid.ColumnSpan="2" TextAlignment="Center" Margin="20"/>

    </Grid>
</Page>
